home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / SetUp / 03 / 18.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-08-06  |  5.7 KB  |  240 lines

  1. /*
  2.                                  Visual FX
  3.                                     For
  4.                                  Image FX
  5.                                SetUp Script
  6.                            Written By J.L. White
  7.  
  8.                          (C)1997 Merlin's Software
  9.  
  10. */
  11. parse arg Num Frames
  12. options results
  13. address "IMAGEFX.1"
  14.     RequestResponse "Do You Need Instructions?"
  15.     if rc = 0 then do
  16.         call Docs()
  17.         end    
  18.  
  19.  
  20. if exists("libs:flyer.library") then do
  21.     if (POS('PROJECT_REXX_PORT',SHOW('Ports')) =0) then do
  22.         RequestNotify 'Flyer Must Be Running First!'
  23.         exit
  24.         end
  25.     call OpenFlyStuff()
  26.  
  27.  
  28.     Gadget.1 = 'D/110/22/120/ImageA Type/4/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
  29.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  30.     if rc ~= 0 then do
  31.         call CloseStuff()
  32.         exit 0
  33.         end
  34.     else do
  35.         IAType = RESULT.1
  36.            end
  37.  
  38.     call GetA()
  39. end
  40. else do
  41.     Gadget.1 = 'D/110/22/120/ImageA Type/2/FRAME/SEQUENCE'
  42.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  43.     if rc ~= 0 then do
  44.         call CloseStuff()
  45.         exit 0
  46.         end
  47.     else do
  48.         IAType = RESULT.1+2
  49.            end
  50.  
  51.     call GetA()
  52. end
  53.  
  54. if FlyOn = 1 then
  55.     call CloseStuff()
  56.  
  57.     Gadget.1 = '  Select Direction Of Glint!  '
  58.     Gadget.2 = '  Top Left To Bottom Right  '
  59.     Gadget.3 = '  Top Right To Bottom Left  '
  60.     Gadget.4 = '  Bottom Left To Top Right  '
  61.     Gadget.5 = '  Bottom Right To Top Left  '
  62.     ListRequest 5 Gadget
  63.     DirectionType = 0
  64.     if result = 2 then DirectionType = 0
  65.     if result = 3 then DirectionType = 1
  66.     if result = 4 then DirectionType = 2
  67.     if result = 5 then DirectionType = 3
  68.  
  69.  
  70.     RequestSlider '"Enter Thickness of Glint!"' 1 100 10
  71.     ThickNum = Result
  72.  
  73.     RequestSlider '"Enter Brightness of Glint!"' 1 255 100
  74.     BrightNum = Result
  75.  
  76.     RequestSlider '"Enter Opacity Of Glint!"' 1 100 50
  77.     BlendNum = Result
  78.  
  79.     RequestSlider '"Enter Amount To Feather Edges!"' 1 50 45
  80.     FeatherNum = Result
  81.  
  82.  
  83. call open TempFile,"VFXIFX:TempDrawer/"strip(Num),W
  84. call writeln TempFile,PicAName
  85. call writeln TempFile,Start
  86. call writeln TempFile,End
  87. call writeln TempFile,IAType
  88. call writeln TempFile,ThickNum
  89. call writeln TempFile,BrightNum
  90. call writeln TempFile,BlendNum
  91. call writeln TempFile,FeatherNum
  92. call writeln TempFile,DirectionType
  93. call close TempFile
  94. exit
  95.  
  96.  
  97. GetFile:
  98.     parse Arg Title, Path
  99.     Address FLY_1 SetString Path
  100.     Address FLY_1 GetFileNameNT Title
  101. return result
  102.  
  103. GetFileName: procedure  
  104.    ARG CompleteName
  105.    c = lastpos("/",CompleteName)
  106.    if c = 0 then c = lastpos(":",CompleteName)
  107.    return substr(CompleteName, c + 1)
  108.  
  109.  
  110. GetA:
  111.  if IAType = 0 then do
  112.     call Switcher(TOSW)
  113.     PicAName = GetFile("Select Flyer Clip For ImageA!  ",DriveName)
  114.     Name = GetFileName(PicAName)
  115.     if Name = "" then do
  116.         Address FLY_1 OK_TEXT " OK "
  117.         Title = "You Must Enter A Valid Clip Name To Use!"
  118.         Address FLY_1 FYINT Title
  119.         Address FLY_1 Quit
  120.         call Switcher(TOWB)
  121.         exit
  122.         end
  123.     Address FLY_1 SetFileName PicAName
  124.     Address FLY_1 GetClipLength PicAName
  125.     End = result
  126.     Start = 0
  127.     Address FLY_1 Program "5"
  128.     Address FLY_1 StartNum Start
  129.     Address FLY_1 EndNum End
  130.     Address FLY_1 CurrentNum "0"
  131.     Address FLY_1 GetTimeNT "Select A Range Of Frames To Process!"
  132.     Start = word(result,1)*2
  133.     End = word(result,2)*2
  134.     Start  = Start + 1
  135.     End = End +2
  136.     call addlib('PROJECT_REXX_PORT' , 0)
  137.     call addlib(TOASTERLIB,0)
  138.     call Switcher(TOWB)
  139.     address command "C:Wait 1"
  140.     ScreenToFront
  141.     end
  142.    if IAType = 1 then do
  143.     RequestFile '"Select Flyer Still For ImageA!"' DriveName ' '
  144.     PicAName = result
  145.     Name = GetFileName(PicAName)
  146.     if Name = "" then do
  147.         Title = "You Must Enter A Valid Name To Use!"
  148.         RequestNotify Title
  149.         if FlyOn = 1 then Address FLY_1 Quit
  150.         exit
  151.         end
  152.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  153.     End = result
  154.     Start = 1
  155.     end
  156.    if IAType = 2 then do
  157.     RequestFile '"Select FileName For ImageA!"' 'SYS:' ' '
  158.     PicAName = result
  159.     Name = GetFileName(PicAName)
  160.     if Name = "" then do
  161.         Title = "You Must Enter A Valid Name To Use!"
  162.         RequestNotify Title
  163.         if FlyOn = 1 then Address FLY_1 Quit
  164.         exit
  165.         end
  166.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  167.     End = result
  168.     Start = 1
  169.     end
  170.    if IAType = 3 then do
  171.     RequestFile '"Select BaseName For ImageA! "' 'SYS:' ' '
  172.     PicAName = result
  173.     Name = GetFileName(PicAName)
  174.     if Name = "" then do
  175.         Title = "You Must Enter A Valid Name To Use!"
  176.         RequestNotify Title
  177.         if FlyOn = 1 then Address FLY_1 Quit
  178.         exit
  179.         end
  180.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  181.     End = result
  182.     Start = 1
  183.     end
  184. return
  185.  
  186. CloseStuff:
  187.     Address FLY_1 Quit
  188.     call remlib('ToasterARexx.port')
  189.     call remlib('PROJECT_REXX_PORT')
  190. return
  191.  
  192.  
  193. OpenFlyStuff:
  194.     FlyOn = 1
  195.     address command "run VFXIFX:FLY" 
  196.     do while (POS('FLY_1',SHOW('Ports')) = 0)
  197.         address command "wait 1"
  198.         end
  199.     TOASTERLIB="ToasterARexx.port"
  200.     call remlib('ToasterARexx.port')
  201.     call remlib('PROJECT_REXX_PORT')
  202.     call addlib('PROJECT_REXX_PORT' , 0)
  203.     call addlib(TOASTERLIB,0)
  204.     DriveName = FindDrive()
  205. return
  206.  
  207.  
  208. FindDrive:
  209.     address command "C:Info >RAM:DriveList"
  210.     call open TempFile,"RAM:DriveList",R
  211.     do until eof(TempFile)
  212.         line = readln(TempFile)
  213.         parse var line Drive" "Rest
  214.         if Drive = "FA0:" then 
  215.             FlyVolume = word(Rest,7)":"
  216.     end
  217.     call close TempFile
  218.     address command "Delete >NIL: RAM:DriveList"
  219. return FlyVolume
  220.  
  221.  
  222.  
  223. Docs:
  224.  
  225.     text1 = '"This effect takes an image and adds a glint of light"'
  226.     text2 = '"scrolling across the face of the image. You can tell"'
  227.     text3 = '"it what direction to go, what thickness, how bright,"'
  228.     text4 = '"and what opacity to use. Select the defaults to see"'
  229.     text5 = '"what we like best, then experiment on your own."'
  230.  
  231.     Gadget.1  = 'TEXT LE=10 TE=4 LB='text1' '
  232.     Gadget.2  = 'TEXT LE=10 TE=14 LB='text2' '
  233.     Gadget.3  = 'TEXT LE=10 TE=24 LB='text3' '
  234.     Gadget.4  = 'TEXT LE=10 TE=34 LB='text4' '
  235.     Gadget.5  = 'TEXT LE=10 TE=44 LB='text5' '
  236.     Gadget.6 = 'END'
  237.     NewComplexRequest  '"Instructions For Effect #18"' Gadget 380 56
  238.  
  239. return
  240.